package com.douya.pangu.business.api.feign;

import com.douya.common.pojo.dto.PagerDTO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.douya.pangu.business.api.pojo.dto.BusinessHttpLogDTO;
import com.douya.pangu.business.api.pojo.vo.BusinessHttpLogVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;

/**
 * 说明：http请求日志内部接口
 *
 * @author hcy
 * @date 2024/04/01
 */
@Validated
@RequestMapping("api/sys/businessHttpLog")
@FeignClient(value = "pangu-business-application", url = "${douya.host.pangu-business:}")
public interface BusinessHttpLogFeign {

    /**
     * 分页获取http请求日志
     *
     * @param pagerDTO 分页条件
     * @return 分页信息
     */
    @GetMapping(value = "page")
    IPage<BusinessHttpLogVO> page(@RequestParam("pagerDTO") PagerDTO pagerDTO);

    /**
    * 根据ID获取http请求日志
    *
    * @param id ID
    * @return http请求日志
    */
    @GetMapping(value = "findById")
    BusinessHttpLogVO findById(@NotNull(message = "ID不能为空") @RequestParam("id") Long id);

    /**
     * 新增/修改http请求日志
     *
     * @param businessHttpLogDTO http请求日志
     */
    @PostMapping(value = "insert")
    void insert(@Validated @RequestBody BusinessHttpLogDTO businessHttpLogDTO);

    /**
     * 根据ID删除http请求日志
     *
     * @param id ID
     */
    @DeleteMapping(value = "delete")
    void delete(@NotNull(message = "ID不能为空") @RequestParam("id") Long id);
}
